An application server, also called an app server, is a software program that runs on computer devices known as server systems. Server systems are typically high-availability, high-performance computer systems that include an organization's backend business logic and store information within databases. Application servers host and expose an organization's backend business logic and processes via various Application Programming Interfaces (APIs) and protocols, possibly including HTTP. Separate instances of an application server can be created on a server system to provide client-specific content.
Application servers typically host complex, transaction-based server applications that run on top of the application servers. One example of a server application is a web application. The server applications are typically designed to be accessed by many simultaneous users. The server applications can access the business logic and private data on the server system via the application server's APIs and protocols. In one example, these server applications are web applications.
User device applications running on user devices request content from the server applications. The server applications deliver the requested content, such as web page content, over a network connection such as the Internet to the user device applications. User devices include mobile phones, tablets, other mobile computing devices, and desktop computers, in examples. All request messages and response messages between the user device applications and the server applications typically occur through an application server.
The architecture of server applications can vary, but common to all server applications, they are designed around the ability to serve multiple users on user devices through a web browser or other interface or user device application. In one example, web browsers send HTTP request messages to the application server for page content from the server applications. The application server, in turn, sends the request for the page content to the server application. The server application then sends the page content to the application server, which the application server includes in an HTTP response messages to the web browser. The web browser or other user device application then renders the page content within a page such as an HTML page.
In order to provide a per user scope for each individual user, server applications such as web applications provide the capability of handling separate sessions for each user. A session is a semi-permanent interactive information interchange, also known as a dialogue, conversation, or meeting, between two or more communicating devices or between a computer and a user. A session is set up or established at a certain point in time and torn down at a later point in time. An established communication session may involve more than one message in each direction. A session is typically, but not always, stateful, meaning that at least one of the communicating parts needs to save information about the session history in order to be able to communicate with another entity. In contrast, stateless session communications involve independent requests and responses.
Session data refers to the in-memory, per-user state associated with sessions. Session data of a web application that communicates with a web browser via an application server is typically stored on the application server. The size of session data is important for scalability as the total session data size is proportional with the number of users concurrently engaged in a session.
A platform or framework is a combination of hardware architecture and/or software that enables software to run on different devices. Software platforms are typically a combination of software libraries and other executables that present well-defined Application Programming Interfaces (“API”). Software developers are increasingly utilizing modern software platforms to enable the creation of platform-independent server applications.
Modern software platforms typically include a programming language, the compiled output of which executes within the context of machine-dependent programs, known as virtual machines (“VM”). VMs permit an isolated processing environment to exist on a computer system. VMs are typically installed directly on top of an operating system of the computer system, such as a server system. VMs hide or abstract the details of the underlying computer system from the software that executes within each VM. To create platform-independent server applications, software developers use platform tools to compile the programming language source code of the server applications into the software executable that runs on the VMs, also known as bytecode.
Java and NetBeans are registered trademarks of Oracle Corporation. Oracle associates the Java trademark with its eponymous computer programming language, Java, the Java Virtual Machine (“JVM,”) and related infrastructure and tools. Oracle associates the NetBeans trademark with its eponymous development platform, NetBeans IDE, and related tools such as NetBeans Profiler. .NET is a registered trademark of Microsoft Corporation. For .NET, Microsoft provides its C# programming language, .NET runtime virtual machine, and related infrastructure and tools.
An example of an application server is a Java application server such as IBM WebSphere, Apache Tomcat, JBoss, Eclipse Jetty, and Glassfish. IBM and WebSphere are registered trademarks of IBM, Inc. JBoss is a registered trademark of RedHat, Inc. Glassfish is a registered trademarks of Oracle, Inc. These Java application servers implement various level of support for the Java 2 Enterprise Edition application server, or J2EE. In these examples, the web applications are Java web applications that run on top of the Java application servers. The Java application servers, in turn, run on top of Java virtual machines.
Another example of an application server is a .NET platform application server that hosts C#-based web applications.
Bytecode is one example of executable code. Bytecode is typically a set of binary files that include platform-neutral instructions for implementing application behavior. The VMs interpret the bytecodes, and execute corresponding native instructions on the target computer system associated with the bytecodes. Examples of software platforms that enable the creation of computer system-independent applications include the Java and .NET platforms.
Server applications are built using program code implemented in a programming language, such as Java. The program code is structured into classes. Classes are further structured into methods. Instances of a class are called objects. Objects include executable versions of the program code. A call hierarchy is a listing that displays all calls to and from a selected method, field or constructor. The call hierarchy enables developers to better understand how the code flows and to evaluate the effects of changes to the code. A call hierarchy is typically in a tree format.
A stack trace is a listing of all objects and their methods invoked during a running server application. Stack traces provide a chain or ordered list of methods. In the stack trace, a developer can follow the specific call hierarchy of each method.
In an error condition, the last called method in a stack trace is the method where the erroneous condition occurred during the runtime operation of the application, such as an exception being thrown. This gives a developer some insight about what the software was attempting to do when the potential problem arose.
A memory snapshot is the image of the in-memory data such as session data for a server application at a certain point in time. Often it is captured automatically when the underlying server application is running out of memory. Specialized memory analyzer tools such as memory profilers have been developed for debugging purposes. Memory profilers allow memory snapshots to be taken on-demand.
Using memory profilers, developers typically look for differences in memory snapshots of an application such as a server application taken at different times in an effort to look for memory leaks in the application. Memory leaks occur when one or more objects allocate memory resources to perform tasks but fail to release the memory resources when the objects have completed those tasks or when the objects are deleted. Each memory snapshot typically includes memory usage information of all objects in the session.
Current state of the art memory analysis tools provide capabilities to take memory snapshots on-demand and to inspect the state of the application at the time the snapshot was taken. One such state-of-the-art memory tool is the Eclipse Memory Analyzer Tool (MAT). Once a snapshot is taken by MAT, developers can inspect the dataset and attempt locating the relevant session data. When developers suspect that a certain use-case takes up too much session data, they must take two different snapshots manually, one before the suspicious use case, and one after.
Analyzing differences between two independent memory snapshots of a session provides information for memory utilization of objects in the session over time. This can be especially useful in finding memory leaks. However, this is a cumbersome and highly time-consuming task that does not provide a guarantee of showing what actually caused memory resource utilization in the session data to grow unexpectedly. A common reason that current memory analysis tools fail to discover memory leaks is that they often cannot reproduce the use case(s) of specific data values that cause the memory leaks.
The memory profiler built into the NetBeans IDE does provide some improvements over MAT. This is because unlike MAT, the NetBeans IDE calculates the diff of two snapshots. However, developers still need to trigger the action taking the memory snapshots when required. Unlike MAT, developers using the NetBeans IDE do not need to manually inspect two different snapshots, since the NetBeans memory profiler provides the diff view.
However, the manual memory snapshots obtained using MAT and the diff view snapshots provided by the NetBeans IDE will still contain all objects on the entire heap, including data structures of many well-known but otherwise irrelevant collections and packages. This creates clutter and adds to search overhead. As a result, the relevant session data that can provide insight into causes of memory leaks can be very difficult to locate in memory snapshots provided by these and other current memory profiler tools.
Developers can sometimes find the causes of a memory leak by analyzing the memory and stack traces of a server application's session data at appropriate times. Many problems, however, require the user to reproduce the memory leaks in order to find their cause. For example, if a developer of a program discovers (e.g. by means of memory analyzer tool, logging statements etc.) an unusual increase in memory consumption that causes a crash of the programs, it is already too late to take new memory snapshots for further analysis. The developer must restart the program, reproduce the issue, and take the memory snapshots at the correct times.
SQL and NoSQL queries are exemplary types of database query language requests. An SQL query is made from a server application's program code to an SQL-based database that stores the server application's data. For typical information systems providing various custom data in web browsers, loading and displaying just one page of data (that includes some changes to the data) requires numerous queries against the database.